package com.zhhh.domain;
// Generated 2019-9-27 10:55:05 by Hibernate Tools 3.4.0.CR1

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * BPosition generated by hbm2java
 */
@Entity
@Table(name = "b_position")
public class BPosition implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private Integer SSysCode;
	private String SCode;
	private String SName;
	private String SDesc;
	private String remark;
	private String OSysCode;

	private List<BOrganization> organizations = new ArrayList<BOrganization>();

	public BPosition() {
	}

	public BPosition(Integer SSysCode, String SCode, String SName, String SDesc, String remark, String OSysCode) {
		this.SSysCode = SSysCode;
		this.SCode = SCode;
		this.SName = SName;
		this.SDesc = SDesc;
		this.remark = remark;
		this.OSysCode = OSysCode;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "s_sys_code")
	public Integer getSSysCode() {
		return this.SSysCode;
	}

	public void setSSysCode(Integer SSysCode) {
		this.SSysCode = SSysCode;
	}

	@Column(name = "s_code", length = 40)
	public String getSCode() {
		return this.SCode;
	}

	public void setSCode(String SCode) {
		this.SCode = SCode;
	}

	@Column(name = "s_name", length = 40)
	public String getSName() {
		return this.SName;
	}

	public void setSName(String SName) {
		this.SName = SName;
	}

	@Column(name = "s_desc", length = 200)
	public String getSDesc() {
		return this.SDesc;
	}

	public void setSDesc(String SDesc) {
		this.SDesc = SDesc;
	}

	@Column(name = "remark", length = 200)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "o_sys_code", length = 40)
	public String getOSysCode() {
		return this.OSysCode;
	}

	public void setOSysCode(String OSysCode) {
		this.OSysCode = OSysCode;
	}

	// 关联组织机构
	@ManyToMany(cascade = CascadeType.REFRESH)
	@JoinTable(name = "b_position_organization", inverseJoinColumns = @JoinColumn(name = "organization_id"), joinColumns = @JoinColumn(name = "position_id"))
	@JsonIgnore // 我中有你你中有我的情况就会出现死循环
	public List<BOrganization> getOrganizations() {
		return organizations;
	}

	public void setOrganizations(List<BOrganization> organizations) {
		this.organizations = organizations;
	}

}
